package Tasks;

import AI.AiEntity;

public class Movement extends Task
{
	int destinationX, destinationY;
	
	public Movement(int x, int y)
	{
		destinationX = x;
		destinationY = y;
	}
	
	public void performTask(AiEntity e) 
	{
		if (e.destinationX != destinationX || e.destinationY != destinationY)
		{
			e.setDestination(destinationX, destinationY);
		}
	}

	public boolean isFinished(AiEntity e) 
	{
		if(finished)
			return true;
		if (e.getX() == destinationX && e.getY() == destinationY)
			return true; 
		else
			return false;
	}
	
}
